﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index2</title>
    <script src="~/script/jquery.js"></script>
    <script src="~/script/jquery.validate.js"></script>
    <script src="~/script/messages_zh.js"></script>
    <style ></style>
</head>
<body>
    <div>
        @using (Html.BeginForm())
        {
            <p>
                用户名：<input id="username" type="text" name="username"/>
            </p>
            <p>
                密码：<input id="password" type="text" name="password" />
            </p>
            <p>
                确认密码：<input id="password2" type="text" name="password2"/>
            </p>
            <input id="Button1" type="submit" value="提交" />
        }
    </div>
    <script>
        $(document).ready(function () {
            $("form").validate({
                rules: {
                    username: { required: true },
                    password: { required: true },
                    password2: { required: true, equalTo: "#password" }
                },
                messages:{
                    username: { required: "请输入用户名" },
                    password: { required: "请输入密码" },
                    password2: {
                        required: "请输入确认密码",
                        equalTo: "两次密码输入不一致，请重新输入密码"
                    }
                }
            })
        })
    </script>
</body>
</html>
